﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Web.Extensions
{
    public static class StringExtensions
    {
        public static string Locale(this string text)
        {
            if (string.IsNullOrEmpty(text))
                return string.Empty;
            string message = WebUnity.Current.LocalizeService.Run<string>(o => o.Localize(text), o => !string.IsNullOrEmpty(text) && !o.Equals(text));
            return string.IsNullOrEmpty(message) ? text : message;
        }
    }
}
